package com.qingcheng.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.goods.SkuService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/sku")
@CrossOrigin
@Controller
public class SkuController {

    @Reference
    private SkuService skuService;

    @RequestMapping("/findPrice")
    @ResponseBody
    public Integer findPrice(String id){

        Integer price = skuService.findPrice(id);
        return  price;
    }

   @RequestMapping("/importAll")
    @ResponseBody
    public boolean importAll(){

       boolean importall = false;
       try {
           importall = skuService.importall();
       } catch (Exception e) {
           e.printStackTrace();
       }
       return  importall;
    }



}
